/**
 * 
 */
package br.com.framework.app.model;

import javax.persistence.AttributeOverride;
import javax.persistence.AttributeOverrides;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

import br.com.framework.persistencia.model.AuditedEntity;

/**
 * @author Cleber
 *
 */
@Entity
@Table(name = "USUARIO")
@AttributeOverrides(@AttributeOverride(name = "id", column = @Column(name = "ID_USUARIO")))
public class Usuario extends AuditedEntity {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	private String login;
	private String senha;
	
	/**
	 * 
	 */
	public Usuario() {
		// TODO Auto-generated constructor stub
	}
	
	/**
	 * @return the login
	 */
	@Column(name = "LOGIN", length = 30, nullable = false)
	@Size(min = 1, max = 30, message = "{usuario.login.invalidSize}")
	@NotNull(message = "{usuario.login.cantBeNull}")
	public String getLogin() {
		return login;
	}

	/**
	 * @param login the login to set
	 */
	public void setLogin(String login) {
		this.login = login;
	}

	/**
	 * @return the senha
	 */
	@Column(name = "SENHA", length = 30, nullable = false)
	@Size(min = 8, max = 30, message = "{usuario.senha.invalidSize}")
	@NotNull(message = "{usuario.senha.cantBeNull}")
	public String getSenha() {
		return senha;
	}

	/**
	 * @param senha the senha to set
	 */
	public void setSenha(String senha) {
		this.senha = senha;
	}

}
